/*****************************************************************************/
#ifndef __DATASAVE_H__
#define __DATASAVE_H__
#include "Parameters.h"
#include "stm32f10x_it.h"

#ifndef OFFSETOF
#define OFFSETOF(TYPE, member) ((size_t) &((TYPE*) 0)->member)
#endif

#define EE_EETEST_ADDR (0)    // 2
#define EE_CAL_ADDR    (10)   // 28

#define EE_BASIC_ADDR (40)       // 21		max960
#define EE_DEV_ADDR   (0x0400)   // 454		max1024
#define EE_CTRL_ADDR  (0x0800)   // 			max8192
#define EE_MAX_ADDR   (EE_DEV_ADDR + 1024)

#define GROW_DAY_MIN    (0)
#define GROW_DAY_MAX    (999)
#define TARGET_TEMP_MAX (500)
#define LOW_TEMP_MAX    (500)
#define HIGH_TEMP_MAX   (500)
#define MODE_MAX        (1)
#define ROOMTYPE_MAX    (6)
#define HUOSEID_MAX     (999)
#define ALARM_DELAY_MAX (999)

int Config_Save(u8 id);
// int Update_SaveData(u8 type, int seq, int len, u8 * buf);
int  EEPROM_SaveData(u8 sid);
int  Load_Param(void);
void Param_Init(void);
//int  ConfigDataCtrl(EDATA_ID id, EDATA_CTRL ctrl, u8* para);
#endif
